package com.blb.edupayservice.feign;

import com.blb.common.entity.UserCourseOrder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 调用订单服务的接口
 */
@FeignClient("edu-order-service")
public interface OrderServiceFeignClient {

    /**
     * 插入订单
     * @param order
     * @return
     */
    @PostMapping("/order")
    ResponseEntity<UserCourseOrder> makeOrder(@RequestBody UserCourseOrder order);

    /**
     * 修改订单状态
     * @param order
     * @return
     */
    @RequestMapping("/order/status")
    ResponseEntity<UserCourseOrder> changeOrderStatus(@RequestBody UserCourseOrder order);

    /**
     * 查询订单
     * @param tradeNo
     * @return
     */
    @RequestMapping("/order/tradeNo")
    ResponseEntity<UserCourseOrder> getOrderByTradeNo(@RequestBody String tradeNo);
}
